/*
 * *****************************************************************************************************************
 * Copyright 2012 Michael Pellaton
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
 * the specific language governing permissions and limitations under the License.
 *
 * Contributors:
 *   Michael Pellaton
 * *****************************************************************************************************************
 */
package li.pellaton.springconfigvalidation.example;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Example @Configuration class resulting in a number of compiler errors and warnings. 
 */
@Configuration
public final class ExampleConfiguration implements ExampleInterface {
  
  @Bean
  public BeanFactoryPostProcessor propertyPlaceholder() {
    return new PreferencesPlaceholderConfigurer();
  }
  
  @Bean
  private static final void invalidBean() { }
  
  @Configuration
  class NestedConfiguration {
  
    @Autowired
    public NestedConfiguration(String value) { }
  }
  
  // Method with potentially missing @Bean annotation
  public String potentialBeanMethod() {
    return "potential";
  }
  
  // Method declared in interface --> @Bean annotation not potentially missinig
  public String methodDeclaredInExampleInterface() {
    return "example";
  }
}
